package top.itlir.edc.service.impl;

import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import top.itlir.edc.dao.StandardRepository;
import top.itlir.edc.domain.Standard;
import top.itlir.edc.service.StandardService;

@Service
@Transactional
public class StandardServiceImpl implements StandardService {
	
	@Autowired
	private StandardRepository standardRepository;

	@Override
	@RequiresPermissions(value="standard:add")
	public void add(Standard standard) {
		standardRepository.save(standard);
	}

	@Override
	public List<Standard> findAll() {
		return standardRepository.findAll();
	}

	@Override
	public Page<Standard> pageQuery(Pageable pageable) {
		return standardRepository.findAll(pageable);
	}

}
